home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-01-16 | 2.6 KB | 64 lines | [TEXT/ToyS] |
- --property l1 : list folder (path to apple menu items folder)
- --property l2 : list folder (path to startup items folder)
- property l1 : {"Last Name", "Middle Name", "First Name", "Personal Title", "Business Name", "Business Street", "Business City", "Business County", "Business Postal Code", "Business Title", "Home Street", "Home City", "Home County", "Home Postal Code", "Notes", "Phone Type", "Phone Number", "EMail Address", "Country"}
- --tell application "FileMaker Pro" to tell database 1 to set l1 to name of every field
- property l2 : {}
-
- set sortDialog to {size:[500, 166], name:"Sort Database Records", style:movable dialog, contents:[¬
- {class:push button, name:"Sort", bounds:[210, 98, 290, 118]}, ¬
- {class:push button, name:"Done", bounds:[210, 134, 290, 154]}, ¬
- {class:push button, name:"Clear All", bounds:[210, 24, 290, 44]}, ¬
- {class:push button, name:"» Move »", bounds:[210, 60, 290, 80], enabled:[dOr, 5, 6]}, ¬
- {class:list box, contents:l1, bounds:[10, 24, 190, 154], action:4}, ¬
- {class:list box, contents:l2, bounds:[310, 24, 490, 154], action:4}, ¬
- {class:static text, contents:"Fields", bounds:[8, 4, 160, 20]}, ¬
- {class:static text, contents:"Sort Order", bounds:[308, 4, 460, 20]}, ¬
- {class:static text, contents:(current date)'s time string, justification:right, bounds:[400, 4, 490, 20]} ¬
- ]}
-
- dd install with grayscale
- set d to dd make dialog sortDialog
- set mov to true
- repeat
- set i to dd interact with user for max ticks 60
- if i = 1 or i = 2 then exit repeat
- if i = 3 then -- Clear All
- set l1 to l1 & l2
- set l2 to []
- dd set contents of item 6 of d to l2
- dd set contents of item 5 of d to l1
- else if i = 4 then
- if mov then -- Move
- set x to dd get value of item 5 of d
- set l2 to l2 & item x of l1
- set l1 to DelItem(l1, x)
- dd set contents of item 5 of d to l1
- dd set contents of item 6 of d to l2
- --dd set value of item 6 of d to length of l2
- else -- Clear
- set x to dd get value of item 6 of d
- set l1 to l1 & item x of l2
- set l2 to DelItem(l2, x)
- dd set contents of item 6 of d to l2
- dd set contents of item 5 of d to l1
- end if
- else if i = 5 then -- List 1
- dd set name of item 4 of d to "» Move »"
- dd set value of item 6 of d to 0
- set mov to true
- else if i = 6 then -- List 2
- dd set name of item 4 of d to "Clear"
- dd set value of item 5 of d to 0
- set mov to false
- end if
- dd set contents of item 9 of d to (current date)'s time string -- Display the time
- end repeat
- dd uninstall
-
- on DelItem(l, i)
- if i = length of l then
- return items 1 thru (i - 1) of l
- else
- return items 1 thru (i - 1) of l & items (i + 1) thru -1 of l
- end if
- end DelItem